/**
 * 
 */
package cn.com.xf.web.form;

import java.util.Date;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.time.DateFormatUtils;
import org.hibernate.validator.constraints.NotEmpty;

import cn.com.xf.domain.TblOaNotice;

/**
 * @author Administrator
 * 
 */
public class NoticeForm extends BaseForm {
	private String id;
	private String notice_id;
	@NotEmpty(message = "标题不能为空")
	private String title;
	private String viceTitle;
	@NotEmpty(message = "内容不能为空")
	private String content;
	private String group;

	private String istop;
	private String isimportant;
	private String publicDepartId;
	@NotEmpty(message = "发布人不能为空")
	private String publicMan;
	private String publicTime;
	private String publicManId;
	private String noticeId;
	private String sendTo;
	private String copyTo;
	private String publicDepart;
	private String siteId;

	private String docNumber;
	private String centerSite;// 中心站点ID（记录发布人所属站点）
	private String empId;

	private String articleId;
	private String isSendMobile;
	private String mobiles;
	
	private String toApp;
	private String toZB;
	private String toZJ;
	private String toFJ;

	public String getNotice_id() {
		return notice_id;
	}

	public void setNotice_id(String notice_id) {
		this.notice_id = notice_id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getGroup() {
		return group;
	}

	public void setGroup(String group) {
		this.group = group;
	}

	public String getIstop() {
		return istop;
	}

	public void setIstop(String istop) {
		this.istop = istop;
	}

	public String getIsimportant() {
		return isimportant;
	}

	public void setIsimportant(String isimportant) {
		this.isimportant = isimportant;
	}

	public String getPublicDepartId() {
		return publicDepartId;
	}

	public void setPublicDepartId(String publicDepartId) {
		this.publicDepartId = publicDepartId;
	}

	public String getPublicMan() {
		return publicMan;
	}

	public void setPublicMan(String publicMan) {
		this.publicMan = publicMan;
	}

	public String getPublicTime() {
		return publicTime;
	}

	public void setPublicTime(String publicTime) {
		this.publicTime = publicTime;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public TblOaNotice copyTo() throws Exception {
		TblOaNotice coreNoitce = new TblOaNotice();
		coreNoitce.setTitle(this.title);
		coreNoitce.setViceTitle(this.viceTitle);
		coreNoitce.setContent(this.content);
		coreNoitce.setNoticeGroup(this.group);
		coreNoitce.setPublicMan(this.publicMan);

		coreNoitce.setPublicTime(new Date());
		coreNoitce.setPublicTimeStr(DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss"));

		if (!StringUtils.isNotBlank(this.istop)) {
			this.istop = "0";
		}
		if (!StringUtils.isNotBlank(this.isimportant)) {
			this.isimportant = "0";
		}
		coreNoitce.setIstop(istop);
		coreNoitce.setIsimportant(isimportant);

		coreNoitce.setPublicDepart(this.publicDepart);
		coreNoitce.setSendto(this.sendTo);
		coreNoitce.setCopyto(this.copyTo);
		coreNoitce.setCenterSite(this.centerSite);
		coreNoitce.setToApp(this.toApp);
		coreNoitce.setPublicManId(this.publicManId);
		coreNoitce.setToZB(this.toZB);;
		coreNoitce.setToZJ(this.toZJ);
		coreNoitce.setToFJ(this.toFJ);
		return coreNoitce;
	}

	public String getNoticeId() {
		return noticeId;
	}

	public void setNoticeId(String noticeId) {
		this.noticeId = noticeId;
	}

	public String getSendTo() {
		return sendTo;
	}

	public void setSendTo(String sendTo) {
		this.sendTo = sendTo;
	}

	public String getCopyTo() {
		return copyTo;
	}

	public void setCopyTo(String copyTo) {
		this.copyTo = copyTo;
	}

	public String getPublicDepart() {
		return publicDepart;
	}

	public void setPublicDepart(String publicDepart) {
		this.publicDepart = publicDepart;
	}

	public String getSiteId() {
		return siteId;
	}

	public void setSiteId(String siteId) {
		this.siteId = siteId;
	}

	public String getDocNumber() {
		return docNumber;
	}

	public void setDocNumber(String docNumber) {
		this.docNumber = docNumber;
	}

	public String getCenterSite() {
		return centerSite;
	}

	public void setCenterSite(String centerSite) {
		this.centerSite = centerSite;
	}

	public String getEmpId() {
		return empId;
	}

	public void setEmpId(String empId) {
		this.empId = empId;
	}

	public String getArticleId() {
		return articleId;
	}

	public void setArticleId(String articleId) {
		this.articleId = articleId;
	}

	public String getMobiles() {
		return mobiles;
	}

	public void setMobiles(String mobiles) {
		this.mobiles = mobiles;
	}

	public String getIsSendMobile() {
		return isSendMobile;
	}

	public void setIsSendMobile(String isSendMobile) {
		this.isSendMobile = isSendMobile;
	}

	public String getToApp() {
		return toApp;
	}

	public void setToApp(String toApp) {
		this.toApp = toApp;
	}

	public String getPublicManId() {
		return publicManId;
	}

	public void setPublicManId(String publicManId) {
		this.publicManId = publicManId;
	}

	public String getToZB() {
		return toZB;
	}

	public void setToZB(String toZB) {
		this.toZB = toZB;
	}

	public String getToZJ() {
		return toZJ;
	}

	public void setToZJ(String toZJ) {
		this.toZJ = toZJ;
	}

	public String getToFJ() {
		return toFJ;
	}

	public void setToFJ(String toFJ) {
		this.toFJ = toFJ;
	}

	public String getViceTitle() {
		return viceTitle;
	}

	public void setViceTitle(String viceTitle) {
		this.viceTitle = viceTitle;
	}
	
}
